home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Scope / Scope Disk #010 (199x)(Scope PD)(US)[WB].zip / Scope Disk #010 (199x)(Scope PD)(US)[WB].adf / BlitLab3 / README < prev    next >
Text File  |  1988-05-14  |  9KB  |  164 lines

  1. BlitLab 1.3                        17 April 88
  2.  
  3.     This is release 1.3, which adds custom screen operation and
  4. a blitter simulator, as well as an undo gadget and a log file.
  5.  
  6.     BlitLab is a program which lets you experiment with the blitter
  7. to your hearts content, in relative safety.  It opens up a workbench
  8. window with gadgets for all of the registers of the blitter, and allows
  9. you to manipulate individual registers and perform blits on a magnified
  10. bitmap.  This documentation is sketchy, but it probably won't get much
  11. better.
  12.  
  13.     This program was written for a blitter presentation at the
  14. BADGE meeting of 16 April 1987, and it met with such approval that I
  15. decided to make it available over the net.  I wrote it for Manx C using
  16. 16 bit ints.  It should port to Lattice with a minimum of effort, but
  17. it doesn't.
  18.  
  19.     The code itself may turn out to be interesting.  I wrote the
  20. entire program in two days, but I tried to keep things clean and
  21. modular.  Any comments on the code, either positive or constructive
  22. criticism, is welcome.
  23.  
  24.     On to the program.  I'm going to describe operation of the
  25. program starting in the upper left hand corner and proceeding across
  26. and down.  I will not describe the operation of the blitter; that's
  27. all in the file blit.tex.
  28.  
  29.     By default, the program opens up in a workbench window.  To
  30. open a custom screen, invoke it with a `-c' argument.
  31.  
  32.     The large dark area in the upper left is the bit map we are
  33. going to play with.  It has a width of 96 bits, or 12 bytes, or 6
  34. words.  It has a height of 32 rows.  Remember these numbers well.
  35. You can draw in this area with the mouse and the two gadgets in the
  36. upper right.  The topmost gadget is the Point/Box gadget.  When set
  37. to point, you can draw individual pixels on the screen by clicking on
  38. the pixels with the select button.  When set to box, you can draw a
  39. filled rectangle by clicking on the upper left hand pixel of the box you
  40. wish to draw with the select button, dragging the mouse and releasing
  41. the select button over the lower left hand pixel.  By using the right
  42. mouse button with either Point or Click, you can clear instead of set
  43. points.  Note that
  44. this is not a paint program, and the interaction speed may not be as
  45. fast as you are used to; no apologies.  It was only intended to draw
  46. bits for the blitter.
  47.  
  48.     Below these two gadgets are two numbers.  The adrs number
  49. holds the address of the word the cursor is currently pointing at,
  50. relative to the beginning of the bit array.  (It is written as, for
  51. instance, M+382, which means the address of the array plus 382 bytes.)
  52. The shift value is the pixel, numbered from 0 at the left to 15 at the
  53. right.  With these values, you can point at a pixel to get its address
  54. to enter into a string gadget below.
  55.  
  56.     The Calc gadget looks at the values you have entered for the
  57. blitter, and determines if any memory other than the bit array will be
  58. modified.  If it will, it prints `Blit unsafe' on the title bar.  This
  59. is a sanity check to keep you from crashing the system.  Carefully check
  60. your values if this flag is on.  The fact that this gadget writes `Blit
  61. unsafe' does not necessarily mean that the blit will destroy memory
  62. outside of the array; careful use of a source operand and mask bits
  63. might not pass this test but would be perfectly okay.  I have
  64. allocated several extra rows above and below the bit array so minor
  65. errors shouldn't crash the system.  Currently line mode is not checked,
  66. so use it with care.
  67.  
  68.     The GO gadget performs the blit you have indicated.  After the
  69. blit, the results are updated in the magnified bit array rather slowly.
  70. It performs the same check performed by Calc before executing, and
  71. complains similarly.  You can override the complaint by clicking on the
  72. GO gadget again.
  73.  
  74.     The UNDO gadget restores the bitmap window to its state before
  75. a blit.  Useful to do a blit, undo it, and redo it after changing
  76. something.  Also helps recover from your errors.
  77.  
  78.     The Real/Simul gadget determines if the real blitter is used,
  79. or if instead the blitter simulator is used.  The simulator is slightly
  80. slower, and does not work in line mode, but it allows you to trace
  81. operation of the blitter to a log file.
  82.  
  83.     Underneath the magnified bit map, on the left, are four gadgets
  84. labeled SX, SY, EX, and EY.  These bits get the starting and ending
  85. points for the line you wish to draw.  The X values should range from
  86. 0 to 95; the Y values from 0 to 31.  These are not checked.  Be aware
  87. that these are not blitter registers; they are simply values that the
  88. program will use in calculating the actual blitter register contents
  89. necessary for the line draw.
  90.  
  91.     The (line)/LINE gadget turns on line mode.  The Setup gadget
  92. takes the SX/SY/EX/EY values, and sets up most of the blitter registers
  93. to draw the line automatically.  It does not set up the function
  94. register, because there are different ways to draw lines.  For a solid
  95. line, use ~AC+A; for a textured line, use ~AC+AB; for an XOR line, use
  96. ~AC+A~C, for instance.  It does not perform the blit, however.  Note
  97. that if you want to draw a new line, you need to change the appropriate
  98. SX/SY/EX/EY values, then click Setup, then click GO.
  99.  
  100.     The next two gadgets, W and H, hold the size of the current
  101. blit.  The W value is in words, and the H value is in bytes.  Legal
  102. values range from 1-64 for W, and 1-1024 for H.  (Of course, the useful
  103. range within this program is much smaller.)
  104.  
  105.     Next to the H gadget are gadgets for the DESC, FCI, IFE, EFE,
  106. SIGN, and OVF bits of the blitter.  These can get set or cleared by
  107. selecting them.
  108. Underneath these gadgets is the Function gadget.  In this gadget you
  109. enter the function you want to perform.  0 is clear all, 255 is set all,
  110. and other combinations can be entered directly as minterms.  For
  111. instance, the A~C+~CA presented earlier means exclusive or the A and C
  112. bits for the destination.  To the right of the Function gadget, you will
  113. find the Log File gadget.  Type a name in this gadget to accumulate a log
  114. file; a null name will result in no file.
  115.  
  116.     The lower left hand corner contains the actual blitter registers
  117. and their values in hexadecimal.  These are the values that are fed to
  118. the blitter when you select GO.  As you enter new numbers into the string
  119. gadgets corresponding to blitter registers, these values will change to
  120. reflect the new values.  (Actually, they will only change if you hit
  121. carriage return after entering the numbers into the string gadget; if you
  122. simply select another gadget after entering data into a string gadget, the
  123. old value will stay displayed until you select CALC or GO.)  This can be
  124. used to calculate minterms, for instance.  Entering ABC+A~B~C+~AB~C+~A~BC
  125. into the Function gadget hitting return will put 96 in the least
  126. significant eight bits of CON0; this is the hexadecimal value reflecting
  127. the above minterms.
  128.  
  129.     At the lower right is a table of string gadgets.  Each row is for
  130. a single DMA channel.  The first column is the USE bit; is that channel
  131. on or off?  Y means on, N means off; selecting the gadget toggles it.  The
  132. next column contains the start address for DMA.  These numbers (as in the
  133. remaining string gadgets) can be entered in decimal, hexadecimal (preceded
  134. by a $), binary (preceded by a %), or as an offset from the start of the bit
  135. array (preceeded by M+).  M alone represents the beginning of the blit
  136. array.  The third column is the modulo value which is added to the DMA
  137. channel pointer at the end of each row; this value is in bytes and can be
  138. negative.  The fourth column is the data register; if a channel is turned
  139. off, its data register can be preloaded with a value, and then it functions
  140. as a constant.  For instance, to fill a block of memory with the value
  141. $E931, simply preload the A data register with this value, turn on only the
  142. D channel, and blit with the function A.  Finally, the last column is the
  143. amount to shift the A and B operands, to the right, before using them.
  144. Finally, in the lower left corner of the DMA channel box are string gadgets
  145. for AFWM and ALWM.
  146.  
  147.     This program has been tested fairly carefully.  Therefore, if the
  148. blitter appears to do something it shouldn't, you probably have set up the
  149. registers wrong.  Remember, the Amiga blitter is a word blitter, not a bit
  150. blitter.  It can be made to look like a bit blitter with some work.  It is
  151. possible, however, that errant blits can muck up some system memory, or
  152. some internal variable memory, so if things really seem awry, reboot and
  153. go back into the program.  Try the same values again, and see if they work
  154. this time.
  155.  
  156. Tomas Rokicki
  157. Radical Eye Software
  158. Box 2081
  159. Stanford, CA  94309
  160. (415) 326-5312
  161. rokicki@polya.stanford.edu
  162. ...lll-crg!decwrl!polya.stanford.edu!rokicki
  163.  
  164.